using UnityEngine;
using System.Collections.Generic;

public enum RoomType
{
    Combat,
    Treasure,
    Event,
    Shop,
    Boss
}

[System.Serializable]
public class RoomPrefab
{
    public GameObject prefab;
    public RoomType roomType;
}

public class Room : MonoBehaviour
{
    public string roomId;
    public RoomType roomType;
    public RoomPrefab prefab;
    public RoomContent content;

    public void Initialize(string id, RoomType type, RoomPrefab prefabData, RoomContent roomContent)
    {
        roomId = id;
        roomType = type;
        prefab = prefabData;
        content = roomContent;
    }
}

public class Floor
{
    public int floorNumber;
    public int difficulty;
    private List<Room> rooms = new List<Room>();
    public Room startingRoom;

    public Floor(int floorNumber, int difficulty)
    {
        this.floorNumber = floorNumber;
        this.difficulty = difficulty;
    }

    public void AddRoom(Room room)
    {
        rooms.Add(room);
    }

    public List<Room> GetAllRooms()
    {
        return rooms;
    }

    public void SetStartingRoom()
    {
        if (rooms.Count > 0)
        {
            startingRoom = rooms[0];
        }
    }
}

public abstract class RoomContent { }

public class CombatRoomContent : RoomContent
{
    public List<EnemyType> enemies = new List<EnemyType>();
}

public class TreasureRoomContent : RoomContent
{
    public List<string> items = new List<string>();
}

public enum EventType
{
    Trap,
    Puzzle,
    Blessing,
    Curse,
    Mystery
}

public enum BossType
{
    GoblinKing,
    DragonLord,
    LichKing,
    DemonLord
}

public class EventRoomContent : RoomContent
{
    public EventType eventType;
}

public class ShopRoomContent : RoomContent
{
    public int itemCount;
    public float basePriceMultiplier;
}

public class BossRoomContent : RoomContent
{
    public BossType bossType;
    public int bossLevel;
}

// public class TreasureRoomContent : RoomContent
// {
//     public int treasureValue;
// }

public enum EnemyType
{
    Goblin,
    Orc,
    Skeleton,
    Dragon
}